$(document).ready(function () {
      var m1 = new MyModal.modal(function() {
        alert("你点击了确定");
      });
      $('.btn1').on("click", function() {
          m1.show();
      });
      // 选项卡
      $(".si-title div span").click(function(){
        var index=$(".si-title div span").index(this);
        $(".si-title div span").css({ borderBottom: "0", color: "#666" });
        $(".si-title div span:eq(" + index + ")").css({ borderBottom: "2px solid #49ade4", color: "#49ade4" });
        $(".si-cons .si-con").css({display:"none"});
        $(".si-cons .si-con:eq(" + index + ")").css({display:"block"});
      })
      // 底部小选项
      $(".ht-footer-btn").click(function(){
        var index=$(".ht-footer-btn").index(this);
        $(".ht-footer-btn").css({color: "#888" });
        $(".ht-footer-btn:eq(" + index + ")").css({color: "#49ade4" });
        if(index==2){

            id=$(this).attr('num');
            location.href="http://www.cnhttx.com/weixin/ShopCart/share/id/"+id+".html";

            takeScreenshot();
        }
      })
      $(".ht-footer-btn").eq(0).click(function(){
        $(".ck-modal").fadeIn(100);
        $(".ck-modal-dialog").animate({
                "margin-top": "35%"
            }, 250);
      })
      $(".ht-close").click(function(){
        $(".ck-modal").fadeOut(100);
      })
      $(".xq").click(function(){
        $('#yc').toggleClass('ht-yc');
      })
      $(".xq2").click(function(){
        $('#yc2').toggleClass('ht-yc');
      })
      $(".ht-close").click(function(){
        $(".xq-modal").fadeOut(100);
      })
      
      // banner图
      // var swiper = new Swiper('.si-photo .swiper-container', {
      //     pagination: '.swiper-pagination',
      //     paginationClickable: true,
      //     paginationBulletRender: function (swiper, index, className) {
      //         return '<span class="' + className + '">' + (index + 1) + '</span>';
      //     },
      //     observer:true,//修改swiper自己或子元素时，自动初始化swiper
      //     observeParents:true,//修改swiper的父元素时，自动初始化swiper
      // });
      var swiper = new Swiper('.si-photo .swiper-container', {
            pagination: '.swiper-pagination',
            slidesPerView: 'auto',
            centeredSlides: true,
            paginationClickable: true,
            spaceBetween: 30,
            autoplay: 1000,//可选选项，自动滑动
            loop: true,//可选选项，开启循环
            observer:true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents:true//修改swiper的父元素时，自动初始化swiper

      });
      //弹出banner
      var mySwiper2 = new Swiper('.si-modal .swiper-container', {
            pagination: '.swiper-pagination',
            paginationType: 'fraction',
            observer:true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents:true,//修改swiper的父元素时，自动初始化swiper
        });
})

